<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Faiss: /data/users/hoss/faiss/VectorTransform.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Faiss
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">/data/users/hoss/faiss/VectorTransform.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright (c) Facebook, Inc. and its affiliates.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * This source code is licensed under the MIT license found in the</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * LICENSE file in the root directory of this source tree.</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">// -*- c++ -*-</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#ifndef FAISS_VECTOR_TRANSFORM_H</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define FAISS_VECTOR_TRANSFORM_H</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor"></span><span class="comment"></span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">/** Defines a few objects that apply transformations to a set of</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * vectors Often these are pre-processing steps.</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &quot;Index.h&quot;</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="keyword">namespace </span>faiss {</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment">/** Any transformation applied on a set of vectors */</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="structfaiss_1_1VectorTransform.html">   26</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structfaiss_1_1VectorTransform.html">VectorTransform</a> {</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    <span class="keyword">typedef</span> <a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">Index::idx_t</a> idx_t;</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    <span class="keywordtype">int</span> d_in;      <span class="comment">///! input dimension</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="structfaiss_1_1VectorTransform.html#a589d612f7b1773614619a0cbecd728a9">   31</a></span>&#160;<span class="comment"></span>    <span class="keywordtype">int</span> <a class="code" href="structfaiss_1_1VectorTransform.html#a589d612f7b1773614619a0cbecd728a9">d_out</a>;     <span class="comment">///! output dimension</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="structfaiss_1_1VectorTransform.html#a137f48bab695736f0b1d79a50cddc858">   33</a></span>&#160;    <span class="keyword">explicit</span> <a class="code" href="structfaiss_1_1VectorTransform.html#a137f48bab695736f0b1d79a50cddc858">VectorTransform</a> (<span class="keywordtype">int</span> d_in = 0, <span class="keywordtype">int</span> <a class="code" href="structfaiss_1_1VectorTransform.html#a589d612f7b1773614619a0cbecd728a9">d_out</a> = 0):</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;    d_in(d_in), <a class="code" href="structfaiss_1_1VectorTransform.html#a589d612f7b1773614619a0cbecd728a9">d_out</a>(<a class="code" href="structfaiss_1_1VectorTransform.html#a589d612f7b1773614619a0cbecd728a9">d_out</a>), <a class="code" href="structfaiss_1_1VectorTransform.html#ab511f1ddf608c00204555881ca28cb02">is_trained</a>(true)</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    {}</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="comment">    /// set if the VectorTransform does not require training, or if</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="comment">    /// training is done already</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="structfaiss_1_1VectorTransform.html#ab511f1ddf608c00204555881ca28cb02">   40</a></span>&#160;<span class="comment"></span>    <span class="keywordtype">bool</span> <a class="code" href="structfaiss_1_1VectorTransform.html#ab511f1ddf608c00204555881ca28cb02">is_trained</a>;</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="comment">    /** Perform training on a representative set of vectors. Does</span></div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="comment">     * nothing by default.</span></div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="comment">     *</span></div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="comment">     * @param n      nb of training vectors</span></div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="comment">     * @param x      training vecors, size n * d</span></div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1VectorTransform.html#a7350d4dd28d60866d55ba4f75d2da84c">train</a> (idx_t n, <span class="keyword">const</span> <span class="keywordtype">float</span> *x);</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="comment">    /** apply the random roation, return new allocated matrix</span></div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="comment">     * @param     x size n * d_in</span></div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="comment">     * @return    size n * d_out</span></div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    <span class="keywordtype">float</span> *<a class="code" href="structfaiss_1_1VectorTransform.html#af3b3a8bf95911f4b28128001c83f91a5">apply</a> (idx_t n, <span class="keyword">const</span> <span class="keywordtype">float</span> * x) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="comment">    /// same as apply, but result is pre-allocated</span></div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="comment"></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1VectorTransform.html#a90f1a218c224c049f1bd8b77a78d6aa0">apply_noalloc</a> (idx_t n, <span class="keyword">const</span> <span class="keywordtype">float</span> * x,</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;                                <span class="keywordtype">float</span> *xt) <span class="keyword">const</span> = 0;</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="comment">    /// reverse transformation. May not be implemented or may return</span></div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="comment">    /// approximate result</span></div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="comment"></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1VectorTransform.html#a101ce54f1c60df19478801aa942470d9">reverse_transform</a> (idx_t n, <span class="keyword">const</span> <span class="keywordtype">float</span> * xt,</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;                                    <span class="keywordtype">float</span> *x) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="structfaiss_1_1VectorTransform.html">VectorTransform</a> () {}</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;};</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="comment">/** Generic linear transformation, with bias term applied on output</span></div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;<span class="comment"> * y = A * x + b</span></div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="structfaiss_1_1LinearTransform.html">   75</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structfaiss_1_1LinearTransform.html">LinearTransform</a>: <a class="code" href="structfaiss_1_1VectorTransform.html">VectorTransform</a> {</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <span class="keywordtype">bool</span> have_bias; <span class="comment">///! whether to use the bias term</span></div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;<span class="comment"></span><span class="comment"></span></div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;<span class="comment">    /// check if matrix A is orthonormal (enables reverse_transform)</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="structfaiss_1_1LinearTransform.html#a8a67a0178eab513cf87545f5d12d9569">   80</a></span>&#160;<span class="comment"></span>    <span class="keywordtype">bool</span> <a class="code" href="structfaiss_1_1LinearTransform.html#a8a67a0178eab513cf87545f5d12d9569">is_orthonormal</a>;</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="comment">    /// Transformation matrix, size d_out * d_in</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="structfaiss_1_1LinearTransform.html#aa40e156ef57fe206cd5f3a58ec0660da">   83</a></span>&#160;<span class="comment"></span>    std::vector&lt;float&gt; <a class="code" href="structfaiss_1_1LinearTransform.html#aa40e156ef57fe206cd5f3a58ec0660da">A</a>;</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="comment">     /// bias vector, size d_out</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="structfaiss_1_1LinearTransform.html#ab0383f690aeb823876e9143febad1a87">   86</a></span>&#160;<span class="comment"></span>    std::vector&lt;float&gt; <a class="code" href="structfaiss_1_1LinearTransform.html#ab0383f690aeb823876e9143febad1a87">b</a>;</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;<span class="comment">    /// both d_in &gt; d_out and d_out &lt; d_in are supported</span></div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="comment"></span>    <span class="keyword">explicit</span> <a class="code" href="structfaiss_1_1LinearTransform.html#a2fffd6064defb7c3fdaf143c0c4a9bc7">LinearTransform</a> (<span class="keywordtype">int</span> d_in = 0, <span class="keywordtype">int</span> <a class="code" href="structfaiss_1_1VectorTransform.html#a589d612f7b1773614619a0cbecd728a9">d_out</a> = 0,</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;                              <span class="keywordtype">bool</span> have_bias = <span class="keyword">false</span>);</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;<span class="comment">    /// same as apply, but result is pre-allocated</span></div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;<span class="comment"></span>    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1LinearTransform.html#af9c20b4ae67691b5713489884ca9f80f">apply_noalloc</a>(idx_t n, <span class="keyword">const</span> <span class="keywordtype">float</span>* x, <span class="keywordtype">float</span>* xt) <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;<span class="comment">    /// compute x = A^T * (x - b)</span></div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="comment">    /// is reverse transform if A has orthonormal lines</span></div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;<span class="comment"></span>    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1LinearTransform.html#a1642efca4f5eb524c29722b0441c4d13">transform_transpose</a> (idx_t n, <span class="keyword">const</span> <span class="keywordtype">float</span> * y,</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;                              <span class="keywordtype">float</span> *x) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;<span class="comment">    /// works only if is_orthonormal</span></div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;<span class="comment"></span>    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1LinearTransform.html#a078caa663cf329de13851ebb026fb5d5">reverse_transform</a> (idx_t n, <span class="keyword">const</span> <span class="keywordtype">float</span> * xt,</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;                            <span class="keywordtype">float</span> *x) <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;<span class="comment">    /// compute A^T * A to set the is_orthonormal flag</span></div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;<span class="comment"></span>    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1LinearTransform.html#aca77897ef5c27c69374b4d9555e5b332">set_is_orthonormal</a> ();</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <span class="keywordtype">bool</span> verbose;</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    ~<a class="code" href="structfaiss_1_1LinearTransform.html">LinearTransform</a>()<span class="keyword"> override </span>{}</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;};</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;<span class="comment">/// Randomly rotate a set of vectors</span></div>
<div class="line"><a name="l00115"></a><span class="lineno"><a class="line" href="structfaiss_1_1RandomRotationMatrix.html">  115</a></span>&#160;<span class="comment"></span><span class="keyword">struct </span><a class="code" href="structfaiss_1_1RandomRotationMatrix.html">RandomRotationMatrix</a>: <a class="code" href="structfaiss_1_1LinearTransform.html">LinearTransform</a> {</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;<span class="comment">     /// both d_in &gt; d_out and d_out &lt; d_in are supported</span></div>
<div class="line"><a name="l00118"></a><span class="lineno"><a class="line" href="structfaiss_1_1RandomRotationMatrix.html#a64e406c8f73c7692bcf7d97b27305fc6">  118</a></span>&#160;<span class="comment"></span>     <a class="code" href="structfaiss_1_1RandomRotationMatrix.html#a64e406c8f73c7692bcf7d97b27305fc6">RandomRotationMatrix</a> (<span class="keywordtype">int</span> d_in, <span class="keywordtype">int</span> <a class="code" href="structfaiss_1_1VectorTransform.html#a589d612f7b1773614619a0cbecd728a9">d_out</a>):</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;         <a class="code" href="structfaiss_1_1LinearTransform.html">LinearTransform</a>(d_in, d_out, false) {}</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;<span class="comment">     /// must be called before the transform is used</span></div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;<span class="comment"></span>     <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1RandomRotationMatrix.html#a857ad8c32fb76b3298d4eea4338ff66f">init</a>(<span class="keywordtype">int</span> seed);</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;     <span class="comment">// intializes with an arbitrary seed</span></div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;     <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1RandomRotationMatrix.html#a5ae68bbd58cf20debb00636cb1b9c490">train</a>(<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">Index::idx_t</a> n, <span class="keyword">const</span> <span class="keywordtype">float</span>* x) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;     <a class="code" href="structfaiss_1_1RandomRotationMatrix.html">RandomRotationMatrix</a> () {}</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;};</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;<span class="comment">/** Applies a principal component analysis on a set of vectors,</span></div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;<span class="comment"> *  with optionally whitening and random rotation. */</span></div>
<div class="line"><a name="l00133"></a><span class="lineno"><a class="line" href="structfaiss_1_1PCAMatrix.html">  133</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structfaiss_1_1PCAMatrix.html">PCAMatrix</a>: <a class="code" href="structfaiss_1_1LinearTransform.html">LinearTransform</a> {</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;<span class="comment">    /** after transformation the components are multiplied by</span></div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;<span class="comment">     * eigenvalues^eigen_power</span></div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;<span class="comment">     *</span></div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;<span class="comment">     * =0: no whitening</span></div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;<span class="comment">     * =-0.5: full whitening</span></div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00141"></a><span class="lineno"><a class="line" href="structfaiss_1_1PCAMatrix.html#a4e48e801f98ba2cf57c03b0913d6fafc">  141</a></span>&#160;    <span class="keywordtype">float</span> <a class="code" href="structfaiss_1_1PCAMatrix.html#a4e48e801f98ba2cf57c03b0913d6fafc">eigen_power</a>;</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;<span class="comment">    /// random rotation after PCA</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"><a class="line" href="structfaiss_1_1PCAMatrix.html#af111f055b7571703a3aa270d89e99321">  144</a></span>&#160;<span class="comment"></span>    <span class="keywordtype">bool</span> <a class="code" href="structfaiss_1_1PCAMatrix.html#af111f055b7571703a3aa270d89e99321">random_rotation</a>;</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;<span class="comment">    /// ratio between # training vectors and dimension</span></div>
<div class="line"><a name="l00147"></a><span class="lineno"><a class="line" href="structfaiss_1_1PCAMatrix.html#abdce90f57a3c4401f5230f03da901e0d">  147</a></span>&#160;<span class="comment"></span>    <span class="keywordtype">size_t</span> <a class="code" href="structfaiss_1_1PCAMatrix.html#abdce90f57a3c4401f5230f03da901e0d">max_points_per_d</a>;</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;<span class="comment">    /// try to distribute output eigenvectors in this many bins</span></div>
<div class="line"><a name="l00150"></a><span class="lineno"><a class="line" href="structfaiss_1_1PCAMatrix.html#ac9a4c97b5861081dfd8ca5881bb1a677">  150</a></span>&#160;<span class="comment"></span>    <span class="keywordtype">int</span> <a class="code" href="structfaiss_1_1PCAMatrix.html#ac9a4c97b5861081dfd8ca5881bb1a677">balanced_bins</a>;</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;<span class="comment">    /// Mean, size d_in</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"><a class="line" href="structfaiss_1_1PCAMatrix.html#a721c338c1df5c99471db82e6d3dc8f93">  153</a></span>&#160;<span class="comment"></span>    std::vector&lt;float&gt; <a class="code" href="structfaiss_1_1PCAMatrix.html#a721c338c1df5c99471db82e6d3dc8f93">mean</a>;</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;<span class="comment">    /// eigenvalues of covariance matrix (= squared singular values)</span></div>
<div class="line"><a name="l00156"></a><span class="lineno"><a class="line" href="structfaiss_1_1PCAMatrix.html#ae80e130c0667b66cea608c4926d7d561">  156</a></span>&#160;<span class="comment"></span>    std::vector&lt;float&gt; <a class="code" href="structfaiss_1_1PCAMatrix.html#ae80e130c0667b66cea608c4926d7d561">eigenvalues</a>;</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;<span class="comment">    /// PCA matrix, size d_in * d_in</span></div>
<div class="line"><a name="l00159"></a><span class="lineno"><a class="line" href="structfaiss_1_1PCAMatrix.html#aef5c130774e5d4f697a3e1c82647bfd3">  159</a></span>&#160;<span class="comment"></span>    std::vector&lt;float&gt; <a class="code" href="structfaiss_1_1PCAMatrix.html#aef5c130774e5d4f697a3e1c82647bfd3">PCAMat</a>;</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    <span class="comment">// the final matrix is computed after random rotation and/or whitening</span></div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    <span class="keyword">explicit</span> <a class="code" href="structfaiss_1_1PCAMatrix.html">PCAMatrix</a> (<span class="keywordtype">int</span> d_in = 0, <span class="keywordtype">int</span> <a class="code" href="structfaiss_1_1VectorTransform.html#a589d612f7b1773614619a0cbecd728a9">d_out</a> = 0,</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;                        <span class="keywordtype">float</span> <a class="code" href="structfaiss_1_1PCAMatrix.html#a4e48e801f98ba2cf57c03b0913d6fafc">eigen_power</a> = 0, <span class="keywordtype">bool</span> <a class="code" href="structfaiss_1_1PCAMatrix.html#af111f055b7571703a3aa270d89e99321">random_rotation</a> = <span class="keyword">false</span>);</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;<span class="comment">    /// train on n vectors. If n &lt; d_in then the eigenvector matrix</span></div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;<span class="comment">    /// will be completed with 0s</span></div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;<span class="comment"></span>    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1PCAMatrix.html#a8f2dd12da8dce3cbeb22da9c5d4ec3e7">train</a>(<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">Index::idx_t</a> n, <span class="keyword">const</span> <span class="keywordtype">float</span>* x) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;<span class="comment">    /// copy pre-trained PCA matrix</span></div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;<span class="comment"></span>    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1PCAMatrix.html#ae586dc89db6c57753c687473417742a6">copy_from</a> (<span class="keyword">const</span> <a class="code" href="structfaiss_1_1PCAMatrix.html">PCAMatrix</a> &amp; other);</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;<span class="comment">    /// called after mean, PCAMat and eigenvalues are computed</span></div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;<span class="comment"></span>    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1PCAMatrix.html#a117a70b8fca6d125725fe49fddebf97b">prepare_Ab</a>();</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;};</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;<span class="keyword">struct </span><a class="code" href="structfaiss_1_1ProductQuantizer.html">ProductQuantizer</a>;</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;<span class="comment">/** Applies a rotation to align the dimensions with a PQ to minimize</span></div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;<span class="comment"> *  the reconstruction error. Can be used before an IndexPQ or an</span></div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;<span class="comment"> *  IndexIVFPQ. The method is the non-parametric version described in:</span></div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;<span class="comment"> * &quot;Optimized Product Quantization for Approximate Nearest Neighbor Search&quot;</span></div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;<span class="comment"> * Tiezheng Ge, Kaiming He, Qifa Ke, Jian Sun, CVPR&#39;13</span></div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00188"></a><span class="lineno"><a class="line" href="structfaiss_1_1OPQMatrix.html">  188</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structfaiss_1_1OPQMatrix.html">OPQMatrix</a>: <a class="code" href="structfaiss_1_1LinearTransform.html">LinearTransform</a> {</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;</div>
<div class="line"><a name="l00190"></a><span class="lineno"><a class="line" href="structfaiss_1_1OPQMatrix.html#a07ad0c0c84f96a6880c1c8eaf09596e3">  190</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="structfaiss_1_1OPQMatrix.html#a07ad0c0c84f96a6880c1c8eaf09596e3">M</a>;          <span class="comment">///&lt; nb of subquantizers</span></div>
<div class="line"><a name="l00191"></a><span class="lineno"><a class="line" href="structfaiss_1_1OPQMatrix.html#a12cb3e05989dee37592b682070c31000">  191</a></span>&#160;<span class="comment"></span>    <span class="keywordtype">int</span> <a class="code" href="structfaiss_1_1OPQMatrix.html#a12cb3e05989dee37592b682070c31000">niter</a>;      <span class="comment">///&lt; Number of outer training iterations</span></div>
<div class="line"><a name="l00192"></a><span class="lineno"><a class="line" href="structfaiss_1_1OPQMatrix.html#ab88c87a3931ec356904abf5f1f797a83">  192</a></span>&#160;<span class="comment"></span>    <span class="keywordtype">int</span> <a class="code" href="structfaiss_1_1OPQMatrix.html#ab88c87a3931ec356904abf5f1f797a83">niter_pq</a>;   <span class="comment">///&lt; Number of training iterations for the PQ</span></div>
<div class="line"><a name="l00193"></a><span class="lineno"><a class="line" href="structfaiss_1_1OPQMatrix.html#a6406e97b05c831cc19b9343be3b43a1f">  193</a></span>&#160;<span class="comment"></span>    <span class="keywordtype">int</span> <a class="code" href="structfaiss_1_1OPQMatrix.html#a6406e97b05c831cc19b9343be3b43a1f">niter_pq_0</a>; <span class="comment">///&lt; same, for the first outer iteration</span></div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;<span class="comment"></span><span class="comment"></span></div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;<span class="comment">    /// if there are too many training points, resample</span></div>
<div class="line"><a name="l00196"></a><span class="lineno"><a class="line" href="structfaiss_1_1OPQMatrix.html#afdd5b2c74d19ccc5c7a6e0199333321a">  196</a></span>&#160;<span class="comment"></span>    <span class="keywordtype">size_t</span> <a class="code" href="structfaiss_1_1OPQMatrix.html#afdd5b2c74d19ccc5c7a6e0199333321a">max_train_points</a>;</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;    <span class="keywordtype">bool</span> verbose;</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;<span class="comment">    /// if non-NULL, use this product quantizer for training</span></div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;<span class="comment">    /// should be constructed with (d_out, M, _)</span></div>
<div class="line"><a name="l00201"></a><span class="lineno"><a class="line" href="structfaiss_1_1OPQMatrix.html#a01d3736c8e725f596b99440324544a59">  201</a></span>&#160;<span class="comment"></span>    <a class="code" href="structfaiss_1_1ProductQuantizer.html">ProductQuantizer</a> * <a class="code" href="structfaiss_1_1OPQMatrix.html#a01d3736c8e725f596b99440324544a59">pq</a>;</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;<span class="comment">    /// if d2 != -1, output vectors of this dimension</span></div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;<span class="comment"></span>    <span class="keyword">explicit</span> <a class="code" href="structfaiss_1_1OPQMatrix.html#a6eb9d18ff15b1c598d3aa3bc9ab84519">OPQMatrix</a> (<span class="keywordtype">int</span> d = 0, <span class="keywordtype">int</span> <a class="code" href="structfaiss_1_1OPQMatrix.html#a07ad0c0c84f96a6880c1c8eaf09596e3">M</a> = 1, <span class="keywordtype">int</span> d2 = -1);</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1OPQMatrix.html#a1e314577db0c6cd4a709503f73eb71e2">train</a>(<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">Index::idx_t</a> n, <span class="keyword">const</span> <span class="keywordtype">float</span>* x) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;};</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;</div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;<span class="comment">/** remap dimensions for intput vectors, possibly inserting 0s</span></div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;<span class="comment"> * strictly speaking this is also a linear transform but we don&#39;t want</span></div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;<span class="comment"> * to compute it with matrix multiplies */</span></div>
<div class="line"><a name="l00213"></a><span class="lineno"><a class="line" href="structfaiss_1_1RemapDimensionsTransform.html">  213</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structfaiss_1_1RemapDimensionsTransform.html">RemapDimensionsTransform</a>: <a class="code" href="structfaiss_1_1VectorTransform.html">VectorTransform</a> {</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;<span class="comment">    /// map from output dimension to input, size d_out</span></div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;<span class="comment">    /// -1 -&gt; set output to 0</span></div>
<div class="line"><a name="l00217"></a><span class="lineno"><a class="line" href="structfaiss_1_1RemapDimensionsTransform.html#a09202a195ff5f75f83e68792751a637f">  217</a></span>&#160;<span class="comment"></span>    std::vector&lt;int&gt; <a class="code" href="structfaiss_1_1RemapDimensionsTransform.html#a09202a195ff5f75f83e68792751a637f">map</a>;</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    <a class="code" href="structfaiss_1_1RemapDimensionsTransform.html">RemapDimensionsTransform</a> (<span class="keywordtype">int</span> d_in, <span class="keywordtype">int</span> <a class="code" href="structfaiss_1_1VectorTransform.html#a589d612f7b1773614619a0cbecd728a9">d_out</a>, <span class="keyword">const</span> <span class="keywordtype">int</span> *<a class="code" href="structfaiss_1_1RemapDimensionsTransform.html#a09202a195ff5f75f83e68792751a637f">map</a>);</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;<span class="comment">    /// remap input to output, skipping or inserting dimensions as needed</span></div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;<span class="comment">    /// if uniform: distribute dimensions uniformly</span></div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;<span class="comment">    /// otherwise just take the d_out first ones.</span></div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;<span class="comment"></span>    <a class="code" href="structfaiss_1_1RemapDimensionsTransform.html">RemapDimensionsTransform</a> (<span class="keywordtype">int</span> d_in, <span class="keywordtype">int</span> <a class="code" href="structfaiss_1_1VectorTransform.html#a589d612f7b1773614619a0cbecd728a9">d_out</a>, <span class="keywordtype">bool</span> uniform = <span class="keyword">true</span>);</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1RemapDimensionsTransform.html#a550be3d40c221d2134bf06a13dd33c4d">apply_noalloc</a>(idx_t n, <span class="keyword">const</span> <span class="keywordtype">float</span>* x, <span class="keywordtype">float</span>* xt) <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;<span class="comment">    /// reverse transform correct only when the mapping is a permuation</span></div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;<span class="comment"></span>    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1RemapDimensionsTransform.html#a2fc83e79e4d3c7853bfd6931cbbaf82a">reverse_transform</a>(idx_t n, <span class="keyword">const</span> <span class="keywordtype">float</span>* xt, <span class="keywordtype">float</span>* x) <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;    <a class="code" href="structfaiss_1_1RemapDimensionsTransform.html">RemapDimensionsTransform</a> () {}</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;};</div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;<span class="comment">/** per-vector normalization */</span></div>
<div class="line"><a name="l00236"></a><span class="lineno"><a class="line" href="structfaiss_1_1NormalizationTransform.html">  236</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structfaiss_1_1NormalizationTransform.html">NormalizationTransform</a>: <a class="code" href="structfaiss_1_1VectorTransform.html">VectorTransform</a> {</div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;    <span class="keywordtype">float</span> norm;</div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;    <span class="keyword">explicit</span> <a class="code" href="structfaiss_1_1NormalizationTransform.html">NormalizationTransform</a> (<span class="keywordtype">int</span> d, <span class="keywordtype">float</span> norm = 2.0);</div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;    <a class="code" href="structfaiss_1_1NormalizationTransform.html">NormalizationTransform</a> ();</div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1NormalizationTransform.html#a80c94dc7d17c9a7a9edc627150401571">apply_noalloc</a>(idx_t n, <span class="keyword">const</span> <span class="keywordtype">float</span>* x, <span class="keywordtype">float</span>* xt) <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;<span class="comment">    /// Identity transform since norm is not revertible</span></div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;<span class="comment"></span>    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1NormalizationTransform.html#a58cc73dea14c1591a8812291d3d85bc0">reverse_transform</a>(idx_t n, <span class="keyword">const</span> <span class="keywordtype">float</span>* xt, <span class="keywordtype">float</span>* x) <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;};</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;<span class="comment">/** Subtract the mean of each component from the vectors. */</span></div>
<div class="line"><a name="l00249"></a><span class="lineno"><a class="line" href="structfaiss_1_1CenteringTransform.html">  249</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structfaiss_1_1CenteringTransform.html">CenteringTransform</a>: <a class="code" href="structfaiss_1_1VectorTransform.html">VectorTransform</a> {</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;<span class="comment">    /// Mean, size d_in = d_out</span></div>
<div class="line"><a name="l00252"></a><span class="lineno"><a class="line" href="structfaiss_1_1CenteringTransform.html#af96e272f0f51d71ed098cdfe3e4ff87d">  252</a></span>&#160;<span class="comment"></span>    std::vector&lt;float&gt; <a class="code" href="structfaiss_1_1CenteringTransform.html#af96e272f0f51d71ed098cdfe3e4ff87d">mean</a>;</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;    <span class="keyword">explicit</span> <a class="code" href="structfaiss_1_1CenteringTransform.html">CenteringTransform</a> (<span class="keywordtype">int</span> d = 0);</div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;<span class="comment">    /// train on n vectors.</span></div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;<span class="comment"></span>    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1CenteringTransform.html#a626c70429e81057d953e173a38f98e3c">train</a>(<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">Index::idx_t</a> n, <span class="keyword">const</span> <span class="keywordtype">float</span>* x) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;<span class="comment">    /// subtract the mean</span></div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;<span class="comment"></span>    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1CenteringTransform.html#aaab940f206cb54321c9729286db5f9d7">apply_noalloc</a>(idx_t n, <span class="keyword">const</span> <span class="keywordtype">float</span>* x, <span class="keywordtype">float</span>* xt) <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;<span class="comment">    /// add the mean</span></div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;<span class="comment"></span>    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1CenteringTransform.html#a6135ee99d20a6b7c033359563a082b99">reverse_transform</a> (idx_t n, <span class="keyword">const</span> <span class="keywordtype">float</span> * xt,</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;                            <span class="keywordtype">float</span> *x) <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;};</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;<span class="comment">/** Index that applies a LinearTransform transform on vectors before</span></div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;<span class="comment"> *  handing them over to a sub-index */</span></div>
<div class="line"><a name="l00271"></a><span class="lineno"><a class="line" href="structfaiss_1_1IndexPreTransform.html">  271</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structfaiss_1_1IndexPreTransform.html">IndexPreTransform</a>: <a class="code" href="structfaiss_1_1Index.html">Index</a> {</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;    std::vector&lt;VectorTransform *&gt; chain;  <span class="comment">///! chain of tranforms</span></div>
<div class="line"><a name="l00274"></a><span class="lineno"><a class="line" href="structfaiss_1_1IndexPreTransform.html#aee3cbbe7915ec9ed13d59ca9276bdefc">  274</a></span>&#160;<span class="comment"></span>    <a class="code" href="structfaiss_1_1Index.html">Index</a> * <a class="code" href="structfaiss_1_1IndexPreTransform.html#aee3cbbe7915ec9ed13d59ca9276bdefc">index</a>;            <span class="comment">///! the sub-index</span></div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00276"></a><span class="lineno"><a class="line" href="structfaiss_1_1IndexPreTransform.html#ae5ec3f184eb211e7d6e204082b52c8c0">  276</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="structfaiss_1_1IndexPreTransform.html#ae5ec3f184eb211e7d6e204082b52c8c0">own_fields</a>;          <span class="comment">///! whether pointers are deleted in destructor</span></div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;    <span class="keyword">explicit</span> <a class="code" href="structfaiss_1_1IndexPreTransform.html">IndexPreTransform</a> (<a class="code" href="structfaiss_1_1Index.html">Index</a> *<a class="code" href="structfaiss_1_1IndexPreTransform.html#aee3cbbe7915ec9ed13d59ca9276bdefc">index</a>);</div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;</div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;    <a class="code" href="structfaiss_1_1IndexPreTransform.html">IndexPreTransform</a> ();</div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;<span class="comment">    /// ltrans is the last transform before the index</span></div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;<span class="comment"></span>    <a class="code" href="structfaiss_1_1IndexPreTransform.html">IndexPreTransform</a> (<a class="code" href="structfaiss_1_1VectorTransform.html">VectorTransform</a> * ltrans, <a class="code" href="structfaiss_1_1Index.html">Index</a> * <a class="code" href="structfaiss_1_1IndexPreTransform.html#aee3cbbe7915ec9ed13d59ca9276bdefc">index</a>);</div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;</div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;    <span class="keywordtype">void</span> prepend_transform (<a class="code" href="structfaiss_1_1VectorTransform.html">VectorTransform</a> * ltrans);</div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1IndexPreTransform.html#a416aaf28d7a533dcf7d2d7de434e993c">train</a>(<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> n, <span class="keyword">const</span> <span class="keywordtype">float</span>* x) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1IndexPreTransform.html#a03c77c582a3421952e2cba2057083059">add</a>(<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> n, <span class="keyword">const</span> <span class="keywordtype">float</span>* x) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1IndexPreTransform.html#a07fef0553b2ef2907f394470f61898b2">add_with_ids</a>(<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> n, <span class="keyword">const</span> <span class="keywordtype">float</span>* x, <span class="keyword">const</span> <span class="keywordtype">long</span>* xids) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1IndexPreTransform.html#a8e48ac9fde5e76e378553b2a6ec2c86e">reset</a>() <span class="keyword">override</span>;</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;<span class="comment">    /** removes IDs from the index. Not supported by all indexes.</span></div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;    <span class="keywordtype">long</span> <a class="code" href="structfaiss_1_1IndexPreTransform.html#ad4e59f4dacc1d8183a788510680f0df5">remove_ids</a>(<span class="keyword">const</span> <a class="code" href="structfaiss_1_1IDSelector.html">IDSelector</a>&amp; sel) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;</div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1IndexPreTransform.html#a7c2c820895d87083742969c281ae4911">search</a>(</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;        <a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> n,</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">float</span>* x,</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;        <a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> k,</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;        <span class="keywordtype">float</span>* distances,</div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;        <a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a>* labels) <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;</div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;    <span class="comment">/* range search, no attempt is done to change the radius */</span></div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1IndexPreTransform.html#a7d19f68aae0c30f1641ed9f2b2303bae">range_search</a> (<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> n, <span class="keyword">const</span> <span class="keywordtype">float</span>* x, <span class="keywordtype">float</span> radius,</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;                       <a class="code" href="structfaiss_1_1RangeSearchResult.html">RangeSearchResult</a>* result) <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;</div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;</div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1IndexPreTransform.html#a02493fc85f4a47dce4ad7acd105320bf">reconstruct</a> (<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> key, <span class="keywordtype">float</span> * recons) <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;</div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1IndexPreTransform.html#a370dd6ef091393401fa9b60e3d1d25b2">reconstruct_n</a> (<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> i0, <a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> ni, <span class="keywordtype">float</span> *recons)</div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;        <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1IndexPreTransform.html#a97ceaf3f87d3d729846762295351e972">search_and_reconstruct</a> (<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> n, <span class="keyword">const</span> <span class="keywordtype">float</span> *x, <a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> k,</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;                                 <span class="keywordtype">float</span> *distances, <a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> *labels,</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;                                 <span class="keywordtype">float</span> *recons) <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;<span class="comment">    /// apply the transforms in the chain. The returned float * may be</span></div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;<span class="comment">    /// equal to x, otherwise it should be deallocated.</span></div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;<span class="comment"></span>    <span class="keyword">const</span> <span class="keywordtype">float</span> * <a class="code" href="structfaiss_1_1IndexPreTransform.html#aa773a5763ebdd1561152b34453fda96d">apply_chain</a> (<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> n, <span class="keyword">const</span> <span class="keywordtype">float</span> *x) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;<span class="comment">    /// Reverse the transforms in the chain. May not be implemented for</span></div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;<span class="comment">    /// all transforms in the chain or may return approximate results.</span></div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;<span class="comment"></span>    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1IndexPreTransform.html#aaa4851311641da569d02f8adbe1f04f0">reverse_chain</a> (<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> n, <span class="keyword">const</span> <span class="keywordtype">float</span>* xt, <span class="keywordtype">float</span>* x) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;</div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;    ~<a class="code" href="structfaiss_1_1IndexPreTransform.html">IndexPreTransform</a>() <span class="keyword">override</span>;</div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;};</div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;</div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;</div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;} <span class="comment">// namespace faiss</span></div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;</div>
<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;</div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="ttc" id="structfaiss_1_1LinearTransform_html_a1642efca4f5eb524c29722b0441c4d13"><div class="ttname"><a href="structfaiss_1_1LinearTransform.html#a1642efca4f5eb524c29722b0441c4d13">faiss::LinearTransform::transform_transpose</a></div><div class="ttdeci">void transform_transpose(idx_t n, const float *y, float *x) const </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00135">VectorTransform.cpp:135</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPreTransform_html_aee3cbbe7915ec9ed13d59ca9276bdefc"><div class="ttname"><a href="structfaiss_1_1IndexPreTransform.html#aee3cbbe7915ec9ed13d59ca9276bdefc">faiss::IndexPreTransform::index</a></div><div class="ttdeci">Index * index</div><div class="ttdoc">! chain of tranforms </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00274">VectorTransform.h:274</a></div></div>
<div class="ttc" id="structfaiss_1_1RandomRotationMatrix_html"><div class="ttname"><a href="structfaiss_1_1RandomRotationMatrix.html">faiss::RandomRotationMatrix</a></div><div class="ttdoc">Randomly rotate a set of vectors. </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00115">VectorTransform.h:115</a></div></div>
<div class="ttc" id="structfaiss_1_1OPQMatrix_html_a12cb3e05989dee37592b682070c31000"><div class="ttname"><a href="structfaiss_1_1OPQMatrix.html#a12cb3e05989dee37592b682070c31000">faiss::OPQMatrix::niter</a></div><div class="ttdeci">int niter</div><div class="ttdoc">Number of outer training iterations. </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00191">VectorTransform.h:191</a></div></div>
<div class="ttc" id="structfaiss_1_1CenteringTransform_html_a626c70429e81057d953e173a38f98e3c"><div class="ttname"><a href="structfaiss_1_1CenteringTransform.html#a626c70429e81057d953e173a38f98e3c">faiss::CenteringTransform::train</a></div><div class="ttdeci">void train(Index::idx_t n, const float *x) override</div><div class="ttdoc">train on n vectors. </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00812">VectorTransform.cpp:812</a></div></div>
<div class="ttc" id="structfaiss_1_1RandomRotationMatrix_html_a64e406c8f73c7692bcf7d97b27305fc6"><div class="ttname"><a href="structfaiss_1_1RandomRotationMatrix.html#a64e406c8f73c7692bcf7d97b27305fc6">faiss::RandomRotationMatrix::RandomRotationMatrix</a></div><div class="ttdeci">RandomRotationMatrix(int d_in, int d_out)</div><div class="ttdoc">both d_in &amp;gt; d_out and d_out &amp;lt; d_in are supported </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00118">VectorTransform.h:118</a></div></div>
<div class="ttc" id="structfaiss_1_1RandomRotationMatrix_html_a857ad8c32fb76b3298d4eea4338ff66f"><div class="ttname"><a href="structfaiss_1_1RandomRotationMatrix.html#a857ad8c32fb76b3298d4eea4338ff66f">faiss::RandomRotationMatrix::init</a></div><div class="ttdeci">void init(int seed)</div><div class="ttdoc">must be called before the transform is used </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00215">VectorTransform.cpp:215</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPreTransform_html_a7d19f68aae0c30f1641ed9f2b2303bae"><div class="ttname"><a href="structfaiss_1_1IndexPreTransform.html#a7d19f68aae0c30f1641ed9f2b2303bae">faiss::IndexPreTransform::range_search</a></div><div class="ttdeci">void range_search(idx_t n, const float *x, float radius, RangeSearchResult *result) const override</div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l01024">VectorTransform.cpp:1024</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPreTransform_html_a8e48ac9fde5e76e378553b2a6ec2c86e"><div class="ttname"><a href="structfaiss_1_1IndexPreTransform.html#a8e48ac9fde5e76e378553b2a6ec2c86e">faiss::IndexPreTransform::reset</a></div><div class="ttdeci">void reset() override</div><div class="ttdoc">removes all elements from the database. </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l01035">VectorTransform.cpp:1035</a></div></div>
<div class="ttc" id="structfaiss_1_1OPQMatrix_html_ab88c87a3931ec356904abf5f1f797a83"><div class="ttname"><a href="structfaiss_1_1OPQMatrix.html#ab88c87a3931ec356904abf5f1f797a83">faiss::OPQMatrix::niter_pq</a></div><div class="ttdeci">int niter_pq</div><div class="ttdoc">Number of training iterations for the PQ. </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00192">VectorTransform.h:192</a></div></div>
<div class="ttc" id="structfaiss_1_1LinearTransform_html_aa40e156ef57fe206cd5f3a58ec0660da"><div class="ttname"><a href="structfaiss_1_1LinearTransform.html#aa40e156ef57fe206cd5f3a58ec0660da">faiss::LinearTransform::A</a></div><div class="ttdeci">std::vector&lt; float &gt; A</div><div class="ttdoc">Transformation matrix, size d_out * d_in. </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00083">VectorTransform.h:83</a></div></div>
<div class="ttc" id="structfaiss_1_1CenteringTransform_html_af96e272f0f51d71ed098cdfe3e4ff87d"><div class="ttname"><a href="structfaiss_1_1CenteringTransform.html#af96e272f0f51d71ed098cdfe3e4ff87d">faiss::CenteringTransform::mean</a></div><div class="ttdeci">std::vector&lt; float &gt; mean</div><div class="ttdoc">Mean, size d_in = d_out. </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00252">VectorTransform.h:252</a></div></div>
<div class="ttc" id="structfaiss_1_1PCAMatrix_html_a4e48e801f98ba2cf57c03b0913d6fafc"><div class="ttname"><a href="structfaiss_1_1PCAMatrix.html#a4e48e801f98ba2cf57c03b0913d6fafc">faiss::PCAMatrix::eigen_power</a></div><div class="ttdeci">float eigen_power</div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00141">VectorTransform.h:141</a></div></div>
<div class="ttc" id="structfaiss_1_1IDSelector_html"><div class="ttname"><a href="structfaiss_1_1IDSelector.html">faiss::IDSelector</a></div><div class="ttdef"><b>Definition:</b> <a href="AuxIndexStructures_8h_source.html#l00054">AuxIndexStructures.h:54</a></div></div>
<div class="ttc" id="structfaiss_1_1LinearTransform_html_a2fffd6064defb7c3fdaf143c0c4a9bc7"><div class="ttname"><a href="structfaiss_1_1LinearTransform.html#a2fffd6064defb7c3fdaf143c0c4a9bc7">faiss::LinearTransform::LinearTransform</a></div><div class="ttdeci">LinearTransform(int d_in=0, int d_out=0, bool have_bias=false)</div><div class="ttdoc">both d_in &amp;gt; d_out and d_out &amp;lt; d_in are supported </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00098">VectorTransform.cpp:98</a></div></div>
<div class="ttc" id="structfaiss_1_1PCAMatrix_html"><div class="ttname"><a href="structfaiss_1_1PCAMatrix.html">faiss::PCAMatrix</a></div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00133">VectorTransform.h:133</a></div></div>
<div class="ttc" id="structfaiss_1_1VectorTransform_html_a137f48bab695736f0b1d79a50cddc858"><div class="ttname"><a href="structfaiss_1_1VectorTransform.html#a137f48bab695736f0b1d79a50cddc858">faiss::VectorTransform::VectorTransform</a></div><div class="ttdeci">VectorTransform(int d_in=0, int d_out=0)</div><div class="ttdoc">! output dimension </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00033">VectorTransform.h:33</a></div></div>
<div class="ttc" id="structfaiss_1_1LinearTransform_html_aca77897ef5c27c69374b4d9555e5b332"><div class="ttname"><a href="structfaiss_1_1LinearTransform.html#aca77897ef5c27c69374b4d9555e5b332">faiss::LinearTransform::set_is_orthonormal</a></div><div class="ttdeci">void set_is_orthonormal()</div><div class="ttdoc">compute A^T * A to set the is_orthonormal flag </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00160">VectorTransform.cpp:160</a></div></div>
<div class="ttc" id="structfaiss_1_1OPQMatrix_html_a01d3736c8e725f596b99440324544a59"><div class="ttname"><a href="structfaiss_1_1OPQMatrix.html#a01d3736c8e725f596b99440324544a59">faiss::OPQMatrix::pq</a></div><div class="ttdeci">ProductQuantizer * pq</div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00201">VectorTransform.h:201</a></div></div>
<div class="ttc" id="structfaiss_1_1OPQMatrix_html"><div class="ttname"><a href="structfaiss_1_1OPQMatrix.html">faiss::OPQMatrix</a></div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00188">VectorTransform.h:188</a></div></div>
<div class="ttc" id="structfaiss_1_1PCAMatrix_html_a8f2dd12da8dce3cbeb22da9c5d4ec3e7"><div class="ttname"><a href="structfaiss_1_1PCAMatrix.html#a8f2dd12da8dce3cbeb22da9c5d4ec3e7">faiss::PCAMatrix::train</a></div><div class="ttdeci">void train(Index::idx_t n, const float *x) override</div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00325">VectorTransform.cpp:325</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPreTransform_html"><div class="ttname"><a href="structfaiss_1_1IndexPreTransform.html">faiss::IndexPreTransform</a></div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00271">VectorTransform.h:271</a></div></div>
<div class="ttc" id="structfaiss_1_1PCAMatrix_html_a721c338c1df5c99471db82e6d3dc8f93"><div class="ttname"><a href="structfaiss_1_1PCAMatrix.html#a721c338c1df5c99471db82e6d3dc8f93">faiss::PCAMatrix::mean</a></div><div class="ttdeci">std::vector&lt; float &gt; mean</div><div class="ttdoc">Mean, size d_in. </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00153">VectorTransform.h:153</a></div></div>
<div class="ttc" id="structfaiss_1_1RemapDimensionsTransform_html_a09202a195ff5f75f83e68792751a637f"><div class="ttname"><a href="structfaiss_1_1RemapDimensionsTransform.html#a09202a195ff5f75f83e68792751a637f">faiss::RemapDimensionsTransform::map</a></div><div class="ttdeci">std::vector&lt; int &gt; map</div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00217">VectorTransform.h:217</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPreTransform_html_aa773a5763ebdd1561152b34453fda96d"><div class="ttname"><a href="structfaiss_1_1IndexPreTransform.html#aa773a5763ebdd1561152b34453fda96d">faiss::IndexPreTransform::apply_chain</a></div><div class="ttdeci">const float * apply_chain(idx_t n, const float *x) const </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00964">VectorTransform.cpp:964</a></div></div>
<div class="ttc" id="structfaiss_1_1PCAMatrix_html_aef5c130774e5d4f697a3e1c82647bfd3"><div class="ttname"><a href="structfaiss_1_1PCAMatrix.html#aef5c130774e5d4f697a3e1c82647bfd3">faiss::PCAMatrix::PCAMat</a></div><div class="ttdeci">std::vector&lt; float &gt; PCAMat</div><div class="ttdoc">PCA matrix, size d_in * d_in. </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00159">VectorTransform.h:159</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPreTransform_html_a416aaf28d7a533dcf7d2d7de434e993c"><div class="ttname"><a href="structfaiss_1_1IndexPreTransform.html#a416aaf28d7a533dcf7d2d7de434e993c">faiss::IndexPreTransform::train</a></div><div class="ttdeci">void train(idx_t n, const float *x) override</div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00906">VectorTransform.cpp:906</a></div></div>
<div class="ttc" id="structfaiss_1_1Index_html_ad3f0d3071f987baabbdd3da4500c87ea"><div class="ttname"><a href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">faiss::Index::idx_t</a></div><div class="ttdeci">long idx_t</div><div class="ttdoc">all indices are this type </div><div class="ttdef"><b>Definition:</b> <a href="Index_8h_source.html#l00062">Index.h:62</a></div></div>
<div class="ttc" id="structfaiss_1_1LinearTransform_html_ab0383f690aeb823876e9143febad1a87"><div class="ttname"><a href="structfaiss_1_1LinearTransform.html#ab0383f690aeb823876e9143febad1a87">faiss::LinearTransform::b</a></div><div class="ttdeci">std::vector&lt; float &gt; b</div><div class="ttdoc">bias vector, size d_out </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00086">VectorTransform.h:86</a></div></div>
<div class="ttc" id="structfaiss_1_1LinearTransform_html_a078caa663cf329de13851ebb026fb5d5"><div class="ttname"><a href="structfaiss_1_1LinearTransform.html#a078caa663cf329de13851ebb026fb5d5">faiss::LinearTransform::reverse_transform</a></div><div class="ttdeci">void reverse_transform(idx_t n, const float *xt, float *x) const override</div><div class="ttdoc">works only if is_orthonormal </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00199">VectorTransform.cpp:199</a></div></div>
<div class="ttc" id="structfaiss_1_1NormalizationTransform_html_a58cc73dea14c1591a8812291d3d85bc0"><div class="ttname"><a href="structfaiss_1_1NormalizationTransform.html#a58cc73dea14c1591a8812291d3d85bc0">faiss::NormalizationTransform::reverse_transform</a></div><div class="ttdeci">void reverse_transform(idx_t n, const float *xt, float *x) const override</div><div class="ttdoc">Identity transform since norm is not revertible. </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00796">VectorTransform.cpp:796</a></div></div>
<div class="ttc" id="structfaiss_1_1LinearTransform_html"><div class="ttname"><a href="structfaiss_1_1LinearTransform.html">faiss::LinearTransform</a></div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00075">VectorTransform.h:75</a></div></div>
<div class="ttc" id="structfaiss_1_1OPQMatrix_html_a1e314577db0c6cd4a709503f73eb71e2"><div class="ttname"><a href="structfaiss_1_1OPQMatrix.html#a1e314577db0c6cd4a709503f73eb71e2">faiss::OPQMatrix::train</a></div><div class="ttdeci">void train(Index::idx_t n, const float *x) override</div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00598">VectorTransform.cpp:598</a></div></div>
<div class="ttc" id="structfaiss_1_1PCAMatrix_html_ac9a4c97b5861081dfd8ca5881bb1a677"><div class="ttname"><a href="structfaiss_1_1PCAMatrix.html#ac9a4c97b5861081dfd8ca5881bb1a677">faiss::PCAMatrix::balanced_bins</a></div><div class="ttdeci">int balanced_bins</div><div class="ttdoc">try to distribute output eigenvectors in this many bins </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00150">VectorTransform.h:150</a></div></div>
<div class="ttc" id="structfaiss_1_1VectorTransform_html_ab511f1ddf608c00204555881ca28cb02"><div class="ttname"><a href="structfaiss_1_1VectorTransform.html#ab511f1ddf608c00204555881ca28cb02">faiss::VectorTransform::is_trained</a></div><div class="ttdeci">bool is_trained</div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00040">VectorTransform.h:40</a></div></div>
<div class="ttc" id="structfaiss_1_1RandomRotationMatrix_html_a5ae68bbd58cf20debb00636cb1b9c490"><div class="ttname"><a href="structfaiss_1_1RandomRotationMatrix.html#a5ae68bbd58cf20debb00636cb1b9c490">faiss::RandomRotationMatrix::train</a></div><div class="ttdeci">void train(Index::idx_t n, const float *x) override</div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00242">VectorTransform.cpp:242</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPreTransform_html_a370dd6ef091393401fa9b60e3d1d25b2"><div class="ttname"><a href="structfaiss_1_1IndexPreTransform.html#a370dd6ef091393401fa9b60e3d1d25b2">faiss::IndexPreTransform::reconstruct_n</a></div><div class="ttdeci">void reconstruct_n(idx_t i0, idx_t ni, float *recons) const override</div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l01059">VectorTransform.cpp:1059</a></div></div>
<div class="ttc" id="structfaiss_1_1CenteringTransform_html_a6135ee99d20a6b7c033359563a082b99"><div class="ttname"><a href="structfaiss_1_1CenteringTransform.html#a6135ee99d20a6b7c033359563a082b99">faiss::CenteringTransform::reverse_transform</a></div><div class="ttdeci">void reverse_transform(idx_t n, const float *xt, float *x) const override</div><div class="ttdoc">add the mean </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00840">VectorTransform.cpp:840</a></div></div>
<div class="ttc" id="structfaiss_1_1NormalizationTransform_html_a80c94dc7d17c9a7a9edc627150401571"><div class="ttname"><a href="structfaiss_1_1NormalizationTransform.html#a80c94dc7d17c9a7a9edc627150401571">faiss::NormalizationTransform::apply_noalloc</a></div><div class="ttdeci">void apply_noalloc(idx_t n, const float *x, float *xt) const override</div><div class="ttdoc">same as apply, but result is pre-allocated </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00786">VectorTransform.cpp:786</a></div></div>
<div class="ttc" id="structfaiss_1_1CenteringTransform_html"><div class="ttname"><a href="structfaiss_1_1CenteringTransform.html">faiss::CenteringTransform</a></div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00249">VectorTransform.h:249</a></div></div>
<div class="ttc" id="structfaiss_1_1VectorTransform_html"><div class="ttname"><a href="structfaiss_1_1VectorTransform.html">faiss::VectorTransform</a></div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00026">VectorTransform.h:26</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPreTransform_html_ae5ec3f184eb211e7d6e204082b52c8c0"><div class="ttname"><a href="structfaiss_1_1IndexPreTransform.html#ae5ec3f184eb211e7d6e204082b52c8c0">faiss::IndexPreTransform::own_fields</a></div><div class="ttdeci">bool own_fields</div><div class="ttdoc">! the sub-index </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00276">VectorTransform.h:276</a></div></div>
<div class="ttc" id="structfaiss_1_1OPQMatrix_html_a6406e97b05c831cc19b9343be3b43a1f"><div class="ttname"><a href="structfaiss_1_1OPQMatrix.html#a6406e97b05c831cc19b9343be3b43a1f">faiss::OPQMatrix::niter_pq_0</a></div><div class="ttdeci">int niter_pq_0</div><div class="ttdoc">same, for the first outer iteration </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00193">VectorTransform.h:193</a></div></div>
<div class="ttc" id="structfaiss_1_1RangeSearchResult_html"><div class="ttname"><a href="structfaiss_1_1RangeSearchResult.html">faiss::RangeSearchResult</a></div><div class="ttdef"><b>Definition:</b> <a href="AuxIndexStructures_8h_source.html#l00031">AuxIndexStructures.h:31</a></div></div>
<div class="ttc" id="structfaiss_1_1VectorTransform_html_a7350d4dd28d60866d55ba4f75d2da84c"><div class="ttname"><a href="structfaiss_1_1VectorTransform.html#a7350d4dd28d60866d55ba4f75d2da84c">faiss::VectorTransform::train</a></div><div class="ttdeci">virtual void train(idx_t n, const float *x)</div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00078">VectorTransform.cpp:78</a></div></div>
<div class="ttc" id="structfaiss_1_1VectorTransform_html_a101ce54f1c60df19478801aa942470d9"><div class="ttname"><a href="structfaiss_1_1VectorTransform.html#a101ce54f1c60df19478801aa942470d9">faiss::VectorTransform::reverse_transform</a></div><div class="ttdeci">virtual void reverse_transform(idx_t n, const float *xt, float *x) const </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00083">VectorTransform.cpp:83</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPreTransform_html_a97ceaf3f87d3d729846762295351e972"><div class="ttname"><a href="structfaiss_1_1IndexPreTransform.html#a97ceaf3f87d3d729846762295351e972">faiss::IndexPreTransform::search_and_reconstruct</a></div><div class="ttdeci">void search_and_reconstruct(idx_t n, const float *x, idx_t k, float *distances, idx_t *labels, float *recons) const override</div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l01071">VectorTransform.cpp:1071</a></div></div>
<div class="ttc" id="structfaiss_1_1RemapDimensionsTransform_html_a2fc83e79e4d3c7853bfd6931cbbaf82a"><div class="ttname"><a href="structfaiss_1_1RemapDimensionsTransform.html#a2fc83e79e4d3c7853bfd6931cbbaf82a">faiss::RemapDimensionsTransform::reverse_transform</a></div><div class="ttdeci">void reverse_transform(idx_t n, const float *xt, float *x) const override</div><div class="ttdoc">reverse transform correct only when the mapping is a permuation </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l01139">VectorTransform.cpp:1139</a></div></div>
<div class="ttc" id="structfaiss_1_1RemapDimensionsTransform_html"><div class="ttname"><a href="structfaiss_1_1RemapDimensionsTransform.html">faiss::RemapDimensionsTransform</a></div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00213">VectorTransform.h:213</a></div></div>
<div class="ttc" id="structfaiss_1_1OPQMatrix_html_afdd5b2c74d19ccc5c7a6e0199333321a"><div class="ttname"><a href="structfaiss_1_1OPQMatrix.html#afdd5b2c74d19ccc5c7a6e0199333321a">faiss::OPQMatrix::max_train_points</a></div><div class="ttdeci">size_t max_train_points</div><div class="ttdoc">if there are too many training points, resample </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00196">VectorTransform.h:196</a></div></div>
<div class="ttc" id="structfaiss_1_1PCAMatrix_html_ae586dc89db6c57753c687473417742a6"><div class="ttname"><a href="structfaiss_1_1PCAMatrix.html#ae586dc89db6c57753c687473417742a6">faiss::PCAMatrix::copy_from</a></div><div class="ttdeci">void copy_from(const PCAMatrix &amp;other)</div><div class="ttdoc">copy pre-trained PCA matrix </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00467">VectorTransform.cpp:467</a></div></div>
<div class="ttc" id="structfaiss_1_1VectorTransform_html_a589d612f7b1773614619a0cbecd728a9"><div class="ttname"><a href="structfaiss_1_1VectorTransform.html#a589d612f7b1773614619a0cbecd728a9">faiss::VectorTransform::d_out</a></div><div class="ttdeci">int d_out</div><div class="ttdoc">! input dimension </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00031">VectorTransform.h:31</a></div></div>
<div class="ttc" id="structfaiss_1_1OPQMatrix_html_a6eb9d18ff15b1c598d3aa3bc9ab84519"><div class="ttname"><a href="structfaiss_1_1OPQMatrix.html#a6eb9d18ff15b1c598d3aa3bc9ab84519">faiss::OPQMatrix::OPQMatrix</a></div><div class="ttdeci">OPQMatrix(int d=0, int M=1, int d2=-1)</div><div class="ttdoc">if d2 != -1, output vectors of this dimension </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00583">VectorTransform.cpp:583</a></div></div>
<div class="ttc" id="structfaiss_1_1Index_html"><div class="ttname"><a href="structfaiss_1_1Index.html">faiss::Index</a></div><div class="ttdef"><b>Definition:</b> <a href="Index_8h_source.html#l00061">Index.h:61</a></div></div>
<div class="ttc" id="structfaiss_1_1PCAMatrix_html_a117a70b8fca6d125725fe49fddebf97b"><div class="ttname"><a href="structfaiss_1_1PCAMatrix.html#a117a70b8fca6d125725fe49fddebf97b">faiss::PCAMatrix::prepare_Ab</a></div><div class="ttdeci">void prepare_Ab()</div><div class="ttdoc">called after mean, PCAMat and eigenvalues are computed </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00477">VectorTransform.cpp:477</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPreTransform_html_a03c77c582a3421952e2cba2057083059"><div class="ttname"><a href="structfaiss_1_1IndexPreTransform.html#a03c77c582a3421952e2cba2057083059">faiss::IndexPreTransform::add</a></div><div class="ttdeci">void add(idx_t n, const float *x) override</div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00993">VectorTransform.cpp:993</a></div></div>
<div class="ttc" id="structfaiss_1_1RemapDimensionsTransform_html_a550be3d40c221d2134bf06a13dd33c4d"><div class="ttname"><a href="structfaiss_1_1RemapDimensionsTransform.html#a550be3d40c221d2134bf06a13dd33c4d">faiss::RemapDimensionsTransform::apply_noalloc</a></div><div class="ttdeci">void apply_noalloc(idx_t n, const float *x, float *xt) const override</div><div class="ttdoc">same as apply, but result is pre-allocated </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l01127">VectorTransform.cpp:1127</a></div></div>
<div class="ttc" id="structfaiss_1_1ProductQuantizer_html"><div class="ttname"><a href="structfaiss_1_1ProductQuantizer.html">faiss::ProductQuantizer</a></div><div class="ttdef"><b>Definition:</b> <a href="ProductQuantizer_8h_source.html#l00023">ProductQuantizer.h:23</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPreTransform_html_aaa4851311641da569d02f8adbe1f04f0"><div class="ttname"><a href="structfaiss_1_1IndexPreTransform.html#aaa4851311641da569d02f8adbe1f04f0">faiss::IndexPreTransform::reverse_chain</a></div><div class="ttdeci">void reverse_chain(idx_t n, const float *xt, float *x) const </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00979">VectorTransform.cpp:979</a></div></div>
<div class="ttc" id="structfaiss_1_1LinearTransform_html_a8a67a0178eab513cf87545f5d12d9569"><div class="ttname"><a href="structfaiss_1_1LinearTransform.html#a8a67a0178eab513cf87545f5d12d9569">faiss::LinearTransform::is_orthonormal</a></div><div class="ttdeci">bool is_orthonormal</div><div class="ttdoc">! whether to use the bias term </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00080">VectorTransform.h:80</a></div></div>
<div class="ttc" id="structfaiss_1_1PCAMatrix_html_ae80e130c0667b66cea608c4926d7d561"><div class="ttname"><a href="structfaiss_1_1PCAMatrix.html#ae80e130c0667b66cea608c4926d7d561">faiss::PCAMatrix::eigenvalues</a></div><div class="ttdeci">std::vector&lt; float &gt; eigenvalues</div><div class="ttdoc">eigenvalues of covariance matrix (= squared singular values) </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00156">VectorTransform.h:156</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPreTransform_html_a7c2c820895d87083742969c281ae4911"><div class="ttname"><a href="structfaiss_1_1IndexPreTransform.html#a7c2c820895d87083742969c281ae4911">faiss::IndexPreTransform::search</a></div><div class="ttdeci">void search(idx_t n, const float *x, idx_t k, float *distances, idx_t *labels) const override</div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l01015">VectorTransform.cpp:1015</a></div></div>
<div class="ttc" id="structfaiss_1_1NormalizationTransform_html"><div class="ttname"><a href="structfaiss_1_1NormalizationTransform.html">faiss::NormalizationTransform</a></div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00236">VectorTransform.h:236</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPreTransform_html_a07fef0553b2ef2907f394470f61898b2"><div class="ttname"><a href="structfaiss_1_1IndexPreTransform.html#a07fef0553b2ef2907f394470f61898b2">faiss::IndexPreTransform::add_with_ids</a></div><div class="ttdeci">void add_with_ids(idx_t n, const float *x, const long *xids) override</div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l01002">VectorTransform.cpp:1002</a></div></div>
<div class="ttc" id="structfaiss_1_1PCAMatrix_html_af111f055b7571703a3aa270d89e99321"><div class="ttname"><a href="structfaiss_1_1PCAMatrix.html#af111f055b7571703a3aa270d89e99321">faiss::PCAMatrix::random_rotation</a></div><div class="ttdeci">bool random_rotation</div><div class="ttdoc">random rotation after PCA </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00144">VectorTransform.h:144</a></div></div>
<div class="ttc" id="structfaiss_1_1PCAMatrix_html_abdce90f57a3c4401f5230f03da901e0d"><div class="ttname"><a href="structfaiss_1_1PCAMatrix.html#abdce90f57a3c4401f5230f03da901e0d">faiss::PCAMatrix::max_points_per_d</a></div><div class="ttdeci">size_t max_points_per_d</div><div class="ttdoc">ratio between # training vectors and dimension </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00147">VectorTransform.h:147</a></div></div>
<div class="ttc" id="structfaiss_1_1VectorTransform_html_af3b3a8bf95911f4b28128001c83f91a5"><div class="ttname"><a href="structfaiss_1_1VectorTransform.html#af3b3a8bf95911f4b28128001c83f91a5">faiss::VectorTransform::apply</a></div><div class="ttdeci">float * apply(idx_t n, const float *x) const </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00070">VectorTransform.cpp:70</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPreTransform_html_ad4e59f4dacc1d8183a788510680f0df5"><div class="ttname"><a href="structfaiss_1_1IndexPreTransform.html#ad4e59f4dacc1d8183a788510680f0df5">faiss::IndexPreTransform::remove_ids</a></div><div class="ttdeci">long remove_ids(const IDSelector &amp;sel) override</div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l01040">VectorTransform.cpp:1040</a></div></div>
<div class="ttc" id="structfaiss_1_1VectorTransform_html_a90f1a218c224c049f1bd8b77a78d6aa0"><div class="ttname"><a href="structfaiss_1_1VectorTransform.html#a90f1a218c224c049f1bd8b77a78d6aa0">faiss::VectorTransform::apply_noalloc</a></div><div class="ttdeci">virtual void apply_noalloc(idx_t n, const float *x, float *xt) const =0</div><div class="ttdoc">same as apply, but result is pre-allocated </div></div>
<div class="ttc" id="structfaiss_1_1IndexPreTransform_html_a02493fc85f4a47dce4ad7acd105320bf"><div class="ttname"><a href="structfaiss_1_1IndexPreTransform.html#a02493fc85f4a47dce4ad7acd105320bf">faiss::IndexPreTransform::reconstruct</a></div><div class="ttdeci">void reconstruct(idx_t key, float *recons) const override</div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l01047">VectorTransform.cpp:1047</a></div></div>
<div class="ttc" id="structfaiss_1_1CenteringTransform_html_aaab940f206cb54321c9729286db5f9d7"><div class="ttname"><a href="structfaiss_1_1CenteringTransform.html#aaab940f206cb54321c9729286db5f9d7">faiss::CenteringTransform::apply_noalloc</a></div><div class="ttdeci">void apply_noalloc(idx_t n, const float *x, float *xt) const override</div><div class="ttdoc">subtract the mean </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00829">VectorTransform.cpp:829</a></div></div>
<div class="ttc" id="structfaiss_1_1OPQMatrix_html_a07ad0c0c84f96a6880c1c8eaf09596e3"><div class="ttname"><a href="structfaiss_1_1OPQMatrix.html#a07ad0c0c84f96a6880c1c8eaf09596e3">faiss::OPQMatrix::M</a></div><div class="ttdeci">int M</div><div class="ttdoc">nb of subquantizers </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8h_source.html#l00190">VectorTransform.h:190</a></div></div>
<div class="ttc" id="structfaiss_1_1LinearTransform_html_af9c20b4ae67691b5713489884ca9f80f"><div class="ttname"><a href="structfaiss_1_1LinearTransform.html#af9c20b4ae67691b5713489884ca9f80f">faiss::LinearTransform::apply_noalloc</a></div><div class="ttdeci">void apply_noalloc(idx_t n, const float *x, float *xt) const override</div><div class="ttdoc">same as apply, but result is pre-allocated </div><div class="ttdef"><b>Definition:</b> <a href="VectorTransform_8cpp_source.html#l00106">VectorTransform.cpp:106</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
